{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "project_info = pd.read_csv('corr.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "projects = list(project_info['project'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def filter_out(pds):\n",
    "    for n in pds:\n",
    "       pds[n] = pds[n][(pds[n]['Total_Goals'] > 50)&(pds[n]['BranchCoverageBitString'].str.contains('1'))]\n",
    "    return pds\n",
    "def get_pds(projects):\n",
    "    r = {}\n",
    "    for p in projects:\n",
    "        r[p] = pd.read_csv(p + \".csv\")\n",
    "        r[p]['BranchCoverageBitString']=r[p].apply(lambda x:str(x['BranchCoverageBitString']),axis=1)\n",
    "        r[p]['project'] = p\n",
    "    return r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>TARGET_CLASS</th>\n",
       "      <th>search_budget</th>\n",
       "      <th>BranchCoverageBitString</th>\n",
       "      <th>Total_Goals</th>\n",
       "      <th>project</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>org.asynchttpclient.netty.NettyResponseStatus</td>\n",
       "      <td>5</td>\n",
       "      <td>0000000000</td>\n",
       "      <td>10</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>org.asynchttpclient.netty.request.body.NettyBy...</td>\n",
       "      <td>5</td>\n",
       "      <td>010</td>\n",
       "      <td>3</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>org.asynchttpclient.netty.future.StackTraceIns...</td>\n",
       "      <td>5</td>\n",
       "      <td>1111000011110110111101111111000001111</td>\n",
       "      <td>37</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>org.asynchttpclient.request.body.generator.Byt...</td>\n",
       "      <td>5</td>\n",
       "      <td>110100000</td>\n",
       "      <td>9</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>org.asynchttpclient.netty.DiscardEvent</td>\n",
       "      <td>5</td>\n",
       "      <td>nan</td>\n",
       "      <td>0</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                        TARGET_CLASS  search_budget  \\\n",
       "0      org.asynchttpclient.netty.NettyResponseStatus              5   \n",
       "1  org.asynchttpclient.netty.request.body.NettyBy...              5   \n",
       "2  org.asynchttpclient.netty.future.StackTraceIns...              5   \n",
       "3  org.asynchttpclient.request.body.generator.Byt...              5   \n",
       "4             org.asynchttpclient.netty.DiscardEvent              5   \n",
       "\n",
       "                 BranchCoverageBitString  Total_Goals            project  \n",
       "0                             0000000000           10  async-http-client  \n",
       "1                                    010            3  async-http-client  \n",
       "2  1111000011110110111101111111000001111           37  async-http-client  \n",
       "3                              110100000            9  async-http-client  \n",
       "4                                    nan            0  async-http-client  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pds = get_pds(projects)\n",
    "pds['async-http-client'].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "pds = filter_out(pds)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>TARGET_CLASS</th>\n",
       "      <th>search_budget</th>\n",
       "      <th>BranchCoverageBitString</th>\n",
       "      <th>Total_Goals</th>\n",
       "      <th>project</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>spark.utils.MimeParse</td>\n",
       "      <td>5</td>\n",
       "      <td>1111111101110000011111111111111111111111110000...</td>\n",
       "      <td>69</td>\n",
       "      <td>spark</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>spark.route.SimpleRouteMatcher</td>\n",
       "      <td>5</td>\n",
       "      <td>0011100000000000000000000000000000000000000000...</td>\n",
       "      <td>93</td>\n",
       "      <td>spark</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>spark.QueryParamsMap</td>\n",
       "      <td>5</td>\n",
       "      <td>0000000000000000000000110000000000000000000000...</td>\n",
       "      <td>52</td>\n",
       "      <td>spark</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      TARGET_CLASS  search_budget  \\\n",
       "18           spark.utils.MimeParse              5   \n",
       "0   spark.route.SimpleRouteMatcher              5   \n",
       "10            spark.QueryParamsMap              5   \n",
       "\n",
       "                              BranchCoverageBitString  Total_Goals project  \n",
       "18  1111111101110000011111111111111111111111110000...           69   spark  \n",
       "0   0011100000000000000000000000000000000000000000...           93   spark  \n",
       "10  0000000000000000000000110000000000000000000000...           52   spark  "
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pds['spark'].sample(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "ret = ret.append(pds['http-request'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>TARGET_CLASS</th>\n",
       "      <th>search_budget</th>\n",
       "      <th>BranchCoverageBitString</th>\n",
       "      <th>Total_Goals</th>\n",
       "      <th>project</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>org.asynchttpclient.Realm</td>\n",
       "      <td>5</td>\n",
       "      <td>0000000000000000000000000000000000000000010000...</td>\n",
       "      <td>179</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>org.asynchttpclient.uri.UriParser</td>\n",
       "      <td>5</td>\n",
       "      <td>1111111111111111111101010111111111111111111111...</td>\n",
       "      <td>154</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>org.asynchttpclient.spnego.SpnegoEngine</td>\n",
       "      <td>5</td>\n",
       "      <td>0111111111111111101100000000000000000000000000...</td>\n",
       "      <td>75</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>com.github.kevinsawicki.http.HttpRequest</td>\n",
       "      <td>5</td>\n",
       "      <td>1110100100001110101111111111111111101101111001...</td>\n",
       "      <td>423</td>\n",
       "      <td>http-request</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                TARGET_CLASS  search_budget  \\\n",
       "63                 org.asynchttpclient.Realm              5   \n",
       "13         org.asynchttpclient.uri.UriParser              5   \n",
       "62   org.asynchttpclient.spnego.SpnegoEngine              5   \n",
       "0   com.github.kevinsawicki.http.HttpRequest              5   \n",
       "\n",
       "                              BranchCoverageBitString  Total_Goals  \\\n",
       "63  0000000000000000000000000000000000000000010000...          179   \n",
       "13  1111111111111111111101010111111111111111111111...          154   \n",
       "62  0111111111111111101100000000000000000000000000...           75   \n",
       "0   1110100100001110101111111111111111101101111001...          423   \n",
       "\n",
       "              project  \n",
       "63  async-http-client  \n",
       "13  async-http-client  \n",
       "62  async-http-client  \n",
       "0        http-request  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ret.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "ret = ret.append(pds['joda-time'].sample(4))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>TARGET_CLASS</th>\n",
       "      <th>search_budget</th>\n",
       "      <th>BranchCoverageBitString</th>\n",
       "      <th>Total_Goals</th>\n",
       "      <th>project</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>org.asynchttpclient.Realm</td>\n",
       "      <td>5</td>\n",
       "      <td>0000000000000000000000000000000000000000010000...</td>\n",
       "      <td>179</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>org.asynchttpclient.uri.UriParser</td>\n",
       "      <td>5</td>\n",
       "      <td>1111111111111111111101010111111111111111111111...</td>\n",
       "      <td>154</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>org.asynchttpclient.spnego.SpnegoEngine</td>\n",
       "      <td>5</td>\n",
       "      <td>0111111111111111101100000000000000000000000000...</td>\n",
       "      <td>75</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>com.github.kevinsawicki.http.HttpRequest</td>\n",
       "      <td>5</td>\n",
       "      <td>1110100100001110101111111111111111101101111001...</td>\n",
       "      <td>423</td>\n",
       "      <td>http-request</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>org.joda.time.chrono.IslamicChronology</td>\n",
       "      <td>5</td>\n",
       "      <td>1110111111111101111110100000111111111110111111...</td>\n",
       "      <td>96</td>\n",
       "      <td>joda-time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>52</th>\n",
       "      <td>org.joda.time.MutablePeriod</td>\n",
       "      <td>5</td>\n",
       "      <td>1111111111111111111111111111111111111111111111...</td>\n",
       "      <td>76</td>\n",
       "      <td>joda-time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>org.joda.time.YearMonthDay</td>\n",
       "      <td>5</td>\n",
       "      <td>1111110111000101101111001011111110110011101000...</td>\n",
       "      <td>83</td>\n",
       "      <td>joda-time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>org.joda.time.Seconds</td>\n",
       "      <td>5</td>\n",
       "      <td>1111111110111111111111111111111111111111111111...</td>\n",
       "      <td>57</td>\n",
       "      <td>joda-time</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                TARGET_CLASS  search_budget  \\\n",
       "63                 org.asynchttpclient.Realm              5   \n",
       "13         org.asynchttpclient.uri.UriParser              5   \n",
       "62   org.asynchttpclient.spnego.SpnegoEngine              5   \n",
       "0   com.github.kevinsawicki.http.HttpRequest              5   \n",
       "40    org.joda.time.chrono.IslamicChronology              5   \n",
       "52               org.joda.time.MutablePeriod              5   \n",
       "63                org.joda.time.YearMonthDay              5   \n",
       "3                      org.joda.time.Seconds              5   \n",
       "\n",
       "                              BranchCoverageBitString  Total_Goals  \\\n",
       "63  0000000000000000000000000000000000000000010000...          179   \n",
       "13  1111111111111111111101010111111111111111111111...          154   \n",
       "62  0111111111111111101100000000000000000000000000...           75   \n",
       "0   1110100100001110101111111111111111101101111001...          423   \n",
       "40  1110111111111101111110100000111111111110111111...           96   \n",
       "52  1111111111111111111111111111111111111111111111...           76   \n",
       "63  1111110111000101101111001011111110110011101000...           83   \n",
       "3   1111111110111111111111111111111111111111111111...           57   \n",
       "\n",
       "              project  \n",
       "63  async-http-client  \n",
       "13  async-http-client  \n",
       "62  async-http-client  \n",
       "0        http-request  \n",
       "40          joda-time  \n",
       "52          joda-time  \n",
       "63          joda-time  \n",
       "3           joda-time  "
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ret.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "ret = ret.append(pds['JSON-java'].sample(5))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>TARGET_CLASS</th>\n",
       "      <th>search_budget</th>\n",
       "      <th>BranchCoverageBitString</th>\n",
       "      <th>Total_Goals</th>\n",
       "      <th>project</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>org.asynchttpclient.Realm</td>\n",
       "      <td>5</td>\n",
       "      <td>0000000000000000000000000000000000000000010000...</td>\n",
       "      <td>179</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>org.asynchttpclient.uri.UriParser</td>\n",
       "      <td>5</td>\n",
       "      <td>1111111111111111111101010111111111111111111111...</td>\n",
       "      <td>154</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>org.asynchttpclient.spnego.SpnegoEngine</td>\n",
       "      <td>5</td>\n",
       "      <td>0111111111111111101100000000000000000000000000...</td>\n",
       "      <td>75</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>com.github.kevinsawicki.http.HttpRequest</td>\n",
       "      <td>5</td>\n",
       "      <td>1110100100001110101111111111111111101101111001...</td>\n",
       "      <td>423</td>\n",
       "      <td>http-request</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>org.joda.time.chrono.IslamicChronology</td>\n",
       "      <td>5</td>\n",
       "      <td>1110111111111101111110100000111111111110111111...</td>\n",
       "      <td>96</td>\n",
       "      <td>joda-time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>52</th>\n",
       "      <td>org.joda.time.MutablePeriod</td>\n",
       "      <td>5</td>\n",
       "      <td>1111111111111111111111111111111111111111111111...</td>\n",
       "      <td>76</td>\n",
       "      <td>joda-time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>org.joda.time.YearMonthDay</td>\n",
       "      <td>5</td>\n",
       "      <td>1111110111000101101111001011111110110011101000...</td>\n",
       "      <td>83</td>\n",
       "      <td>joda-time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>org.joda.time.Seconds</td>\n",
       "      <td>5</td>\n",
       "      <td>1111111110111111111111111111111111111111111111...</td>\n",
       "      <td>57</td>\n",
       "      <td>joda-time</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>org.json.XML</td>\n",
       "      <td>5</td>\n",
       "      <td>1011111111111111111011111111111110101100110000...</td>\n",
       "      <td>269</td>\n",
       "      <td>JSON-java</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>org.json.JSONWriter</td>\n",
       "      <td>5</td>\n",
       "      <td>1111111011111101111101111111111111111111111011...</td>\n",
       "      <td>84</td>\n",
       "      <td>JSON-java</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>org.json.CDL</td>\n",
       "      <td>5</td>\n",
       "      <td>1111010111111101111101101101101101110111110101...</td>\n",
       "      <td>94</td>\n",
       "      <td>JSON-java</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>org.json.Cookie</td>\n",
       "      <td>5</td>\n",
       "      <td>1110111111111111110101001011111111111111010111...</td>\n",
       "      <td>65</td>\n",
       "      <td>JSON-java</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>org.json.JSONML</td>\n",
       "      <td>5</td>\n",
       "      <td>1111111111111111100000110001000000000000000001...</td>\n",
       "      <td>143</td>\n",
       "      <td>JSON-java</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                TARGET_CLASS  search_budget  \\\n",
       "63                 org.asynchttpclient.Realm              5   \n",
       "13         org.asynchttpclient.uri.UriParser              5   \n",
       "62   org.asynchttpclient.spnego.SpnegoEngine              5   \n",
       "0   com.github.kevinsawicki.http.HttpRequest              5   \n",
       "40    org.joda.time.chrono.IslamicChronology              5   \n",
       "52               org.joda.time.MutablePeriod              5   \n",
       "63                org.joda.time.YearMonthDay              5   \n",
       "3                      org.joda.time.Seconds              5   \n",
       "11                              org.json.XML              5   \n",
       "8                        org.json.JSONWriter              5   \n",
       "4                               org.json.CDL              5   \n",
       "7                            org.json.Cookie              5   \n",
       "2                            org.json.JSONML              5   \n",
       "\n",
       "                              BranchCoverageBitString  Total_Goals  \\\n",
       "63  0000000000000000000000000000000000000000010000...          179   \n",
       "13  1111111111111111111101010111111111111111111111...          154   \n",
       "62  0111111111111111101100000000000000000000000000...           75   \n",
       "0   1110100100001110101111111111111111101101111001...          423   \n",
       "40  1110111111111101111110100000111111111110111111...           96   \n",
       "52  1111111111111111111111111111111111111111111111...           76   \n",
       "63  1111110111000101101111001011111110110011101000...           83   \n",
       "3   1111111110111111111111111111111111111111111111...           57   \n",
       "11  1011111111111111111011111111111110101100110000...          269   \n",
       "8   1111111011111101111101111111111111111111111011...           84   \n",
       "4   1111010111111101111101101101101101110111110101...           94   \n",
       "7   1110111111111111110101001011111111111111010111...           65   \n",
       "2   1111111111111111100000110001000000000000000001...          143   \n",
       "\n",
       "              project  \n",
       "63  async-http-client  \n",
       "13  async-http-client  \n",
       "62  async-http-client  \n",
       "0        http-request  \n",
       "40          joda-time  \n",
       "52          joda-time  \n",
       "63          joda-time  \n",
       "3           joda-time  \n",
       "11          JSON-java  \n",
       "8           JSON-java  \n",
       "4           JSON-java  \n",
       "7           JSON-java  \n",
       "2           JSON-java  "
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ret.head(20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "ret = ret.append(pds['jsoup'].sample(4))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "ret = ret.append(pds['spark'].sample(3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>TARGET_CLASS</th>\n",
       "      <th>search_budget</th>\n",
       "      <th>BranchCoverageBitString</th>\n",
       "      <th>Total_Goals</th>\n",
       "      <th>project</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>org.asynchttpclient.Realm</td>\n",
       "      <td>5</td>\n",
       "      <td>0000000000000000000000000000000000000000010000...</td>\n",
       "      <td>179</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>org.asynchttpclient.uri.UriParser</td>\n",
       "      <td>5</td>\n",
       "      <td>1111111111111111111101010111111111111111111111...</td>\n",
       "      <td>154</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>org.asynchttpclient.spnego.SpnegoEngine</td>\n",
       "      <td>5</td>\n",
       "      <td>0111111111111111101100000000000000000000000000...</td>\n",
       "      <td>75</td>\n",
       "      <td>async-http-client</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>com.github.kevinsawicki.http.HttpRequest</td>\n",
       "      <td>5</td>\n",
       "      <td>1110100100001110101111111111111111101101111001...</td>\n",
       "      <td>423</td>\n",
       "      <td>http-request</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>org.joda.time.chrono.IslamicChronology</td>\n",
       "      <td>5</td>\n",
       "      <td>1110111111111101111110100000111111111110111111...</td>\n",
       "      <td>96</td>\n",
       "      <td>joda-time</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                TARGET_CLASS  search_budget  \\\n",
       "63                 org.asynchttpclient.Realm              5   \n",
       "13         org.asynchttpclient.uri.UriParser              5   \n",
       "62   org.asynchttpclient.spnego.SpnegoEngine              5   \n",
       "0   com.github.kevinsawicki.http.HttpRequest              5   \n",
       "40    org.joda.time.chrono.IslamicChronology              5   \n",
       "\n",
       "                              BranchCoverageBitString  Total_Goals  \\\n",
       "63  0000000000000000000000000000000000000000010000...          179   \n",
       "13  1111111111111111111101010111111111111111111111...          154   \n",
       "62  0111111111111111101100000000000000000000000000...           75   \n",
       "0   1110100100001110101111111111111111101101111001...          423   \n",
       "40  1110111111111101111110100000111111111110111111...           96   \n",
       "\n",
       "              project  \n",
       "63  async-http-client  \n",
       "13  async-http-client  \n",
       "62  async-http-client  \n",
       "0        http-request  \n",
       "40          joda-time  "
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ret.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "#ret.to_csv('corr_sample.csv')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
